package com.cms.content.article.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cms.content.article.dao.ArticleCatDAO;
import com.cms.content.article.pojo.ArticleCat;
import com.cms.content.article.service.ArticleCatService;
@Service
public class ArticleCatServiceImpl implements ArticleCatService {
	@Autowired
	ArticleCatDAO articleCatDAO;
	@Override
	public boolean saveArticleCat(ArticleCat articleCat) {
		if(articleCat.getId()==null){
			return articleCatDAO.insert(articleCat)>0;
		}else{
			return articleCatDAO.updateByPrimaryKey(articleCat)>0;
		}
	}

	@Override
	public boolean deleteByCatId(Integer catId) {
		return articleCatDAO.deleteByPrimaryKey(catId)>0;
	}

	@Override
	public ArticleCat findByCatId(Integer catId) {
		return articleCatDAO.selectByPrimaryKey(catId);
	}

	@Override
	public List<ArticleCat> findList() {
		// TODO Auto-generated method stub
		return null;
	}

}
